﻿@using XStudio.XCRF.Data.Entities.BasicInfo
@using XStudio.XCRF.Web.Models.Enums
@model BasicInfo
@(Html.Telerik().Grid<BasicRadio>().Name("BasicRadioViewGrid").Footer(false)
.DataKeys(keys => keys.Add(radio => radio.ID))
.Columns(columns =>
{
    columns.ForeignKey(radio => radio.Place, RadioPlaceTypeInfo.SelectListItems, "Value", "Text").Title("部位").EditorTemplateName("RadioPlace");
    columns.Bound(radio => radio.Dose).Title("剂量").Width("170px").EditorTemplateName("NumericText");
    columns.Bound(radio => radio.Times).Title("次数").Width("170px").EditorTemplateName("NumericText");
    columns.Bound(radio => radio.Remark).Title("备注");
    columns.Command(commands =>
    {
        commands.Edit().ButtonType(GridButtonType.Text);
        commands.Delete().ButtonType(GridButtonType.Text);
    }).Title("操作");
})
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text))
.DataBinding(dataBinding =>
{
    dataBinding.Ajax()
        .Select<BasicInfoController>(c => c._BasicRadioList(Model.ID))
        .Insert<BasicInfoController>(c => c._BasicRadioAdd(null, Model.ID))
        .Update<BasicInfoController>(c => c._BasicRadioEdit(null))
        .Delete<BasicInfoController>(c => c._BasicRadioDelete(null));
})
.Editable(edit => edit.Mode(GridEditMode.InLine))
)